{extend name="base"/}
{block name="title"}{/block}
{block name="css"}{/block}
{block name="content"}
    <!-- 内容主体区域 -->
    <div style="padding: 30px;">
        <fieldset class="layui-elem-field">
            <legend>系统设置 - 积分签到设置</legend>
            <div class="layui-field-box">
                <form class="layui-form" action="">
                    <div class="layui-form-item">
                        <label class="layui-form-label">每天获得积分</label>
                        <div class="layui-input-block">
                          <input  style="width: 40%;" type="text" name="check_in" value="{$info.tip}" id="appkey" class="layui-input">
                        </div>
                      </div>

                    <div class="layui-form-item">
                        <div class="layui-input-block">
                        <button class="layui-btn" id="btnbtn"  lay-submit lay-filter="formDemo">立即提交</button>
                        </div>
                    </div>
                </form>
            </div>
        </fieldset>
    </div>
    {/block}
    {block name="js"}
<script>
    var layer;
    $("#btnbtn").click(function(){
        var tip = $("#appkey").val();
        $.ajax({
            type: "POST",
            url: "{:url('backend/config/check')}",
            data: {
                tip:tip,
            },
            success: function(data){
                if(data.code==1){
                    top.layer.msg("保存成功!");
                    //刷新父页面
                    setTimeout(parent.location.reload(),2000);
                }else{
                    top.layer.msg(data.msg);
                }
            }
        })
    })
</script>
{/block}